package com.xiaocikuai.smallchunks.service.Transaction.impl;

import com.xiaocikuai.smallchunks.entity.Transaction.Order;
import com.xiaocikuai.smallchunks.entity.Transaction.RealOrder;
import com.xiaocikuai.smallchunks.mapper.Transaction.RealOrderMapper;
import com.xiaocikuai.smallchunks.service.Transaction.IRealOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaocikuai.smallchunks.utils.JWTservice.JwtService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 实体商品购买管理 服务实现类
 * </p>
 *
 * @author author1
 * @since 2024-07-13
 */
@Service
public class RealOrderServiceImpl extends ServiceImpl<RealOrderMapper, RealOrder> implements IRealOrderService {

    @Resource
    private JwtService jwtService;

//    public List<HashMap<String,Object>> selectUserOrder(RealOrder order, String token){
//
//        List<Order> orders = new ArrayList<>();
//        switch (order.getMode()){
////            case 0 -> orders = selectUserOrderInfo(token);
////            case 1 -> orders = selectUserOrderAP(token);
////            case 2 -> orders = selectUserOrderAR(token);
////            case 3 -> orders = selectUserOrderF(token);
//        }
//        return orders;
//    }

//
//    public List<Order> selectUserOrderInfo(String token){
//        int uid = jwtService.deconstruction(token).getUid();
//        return lambdaQuery().eq( Order::getUid ,uid ).select().list();
//    }
//
//    public List<Order> selectUserOrderAP(String token){
//        int uid = jwtService.deconstruction(token).getUid();
//        return lambdaQuery().eq( Order::getUid ,uid ).eq(Order::getStatus,0).select().list();
//    }
//
//    public List<Order> selectUserOrderAR(String token){
//        int uid = jwtService.deconstruction(token).getUid();
//        return lambdaQuery().eq( Order::getUid ,uid ).eq(Order::getStatus,1).select().list();
//    }
//
//    public List<Order> selectUserOrderF(String token){
//        int uid = jwtService.deconstruction(token).getUid();
//        return lambdaQuery().eq( Order::getUid ,uid ).eq(Order::getStatus,2).select().list();
//    }

}
